/*****************************************************************************/
/*                                                                           */
/*              Grobal Variables                                             */
/*                                                                           */
/*****************************************************************************/
#ifndef __GLOBAL_H__
#define __GLOBAL_H__



//---------------------------------- CPU --------------------------------------
extern	DATA 	WORD    tic01;

extern	XDATA 	BYTE	RS_buf[];
extern	DATA 	BYTE	RS_in, RS_out;
extern			bit		RS_Xbusy;
extern			bit		F_watch;

extern	DATA	BYTE	XDATA * data regTW88;

extern	DATA	BYTE	EXINT_STATUS;

extern  XDATA	BYTE	REMOTE_buf[4];
extern			bit		RM_get;

//-------------------------- Monitor ------------------------------
extern	XDATA	BYTE	MonAddress;	
extern	XDATA	BYTE	MonIndex;
extern	XDATA	BYTE	MonRdata, MonWdata;
extern	XDATA	BYTE	monstr[];		// buffer for input string
extern	XDATA	BYTE 	*argv[];
extern	XDATA	BYTE	argc;
extern			bit		echo;

extern			BYTE 	*MonString;

extern			BYTE	PageREG;

//===================== Timer =================================================
extern XDATA BYTE NVMBuffer[];			// SPI DMA has limitation under 1K address, 0x400

//===================== Timer =================================================

//===================== TouchMSG ==============================================
extern U16 StartPtX;
extern U16 StartPtY;
extern S16 PrevVtX;
extern S16 PrevVtY;

//===================== TouchAdj ==============================================
extern WORD Xres;
extern WORD Yres;
extern S8 Xslope;
extern S8 Yslope;
extern LONG Xoff;
extern LONG Yoff;

//===================== GPIO ==================================================
#define SwapLED113 {P1_3 ^= 1;}
#define SwapLED114 {P1_4 ^= 1;}

#ifdef TW8823EVB
#define SwapLED116 {;}
#define SwapLED115 {;}
#endif

#ifdef TW8823SHDEMO
extern			bit 	D115_ON;
#define SwapLED116 {P1_2 ^= 1;}
#define SwapLED115 {D115_ON ^= 1; P3_5 = D115_ON;}
#endif


#endif // __GLOBAL_H__

